import 'package:flutter/material.dart';
import 'package:flutter_application_1/siginin.dart';

class PersonPage extends StatefulWidget {
  PersonPage({Key key}) : super(key: key);

  @override
  _PersonPageState createState() {
    return _PersonPageState();
  }
}

class _PersonPageState extends State<PersonPage> {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('我的'),
        actions: <Widget>[
          IconButton(
            icon: Icon(Icons.logout),
            onPressed: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (BuildContext context) {
                    return SigninPage();
                  },
                ),
              );
            },
          ),
        ],
      ),
      body: Center(
        child: Column(
          children: [
            Text('person center'),
            IconButton(
              icon: Icon(Icons.login),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (BuildContext context) {
                      return SigninPage();
                    },
                  ),
                );
                // Navigator.pushAndRemoveUntil(context,
                //     MaterialPageRoute(builder: (BuildContext context) {
                //   return SigninPage();
                // }), (Route) => Route == null);
              },
            )
          ],
        ),
      ),
    );
  }
}
